﻿var validFunction;
var invalidFunction;
function initFunctions(lbl, div, icon, text) {
    validFunction = function () {
        var errorMessage = document.getElementById(lbl);
        var divToChange = document.getElementById(div);
        var spanToChange = document.getElementById(icon);
        divToChange.classList.remove("has-error");
        spanToChange.classList.remove("glyphicon-remove");
        divToChange.classList.add("has-success");
        spanToChange.classList.add("glyphicon-ok");
        errorMessage.classList.add("invisible");
    };
    invalidFunction = function () {
        var errorMessage = document.getElementById(lbl);
        var divToChange = document.getElementById(div);
        var spanToChange = document.getElementById(icon);
        divToChange.classList.remove("has-success");
        spanToChange.classList.remove("glyphicon-ok");
        divToChange.classList.add("has-error");
        spanToChange.classList.add("glyphicon-remove");
        errorMessage.classList.remove("invisible");
        errorMessage.innerHTML = text;
    }
}